package com.wl4837;

// 1. 实现Cloneable接口
class Prototype implements Cloneable {
    private String property;

    public Prototype(String property) {
        this.property = property;
    }

    // 2. 重写clone方法
    @Override
    public Prototype clone() {
        try {
            return (Prototype) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
            return null;
        }
    }

    public String getProperty() {
        return property;
    }

    public void setProperty(String property) {
        this.property = property;
    }
}